<?php
namespace Models;

class AlbumArray
{
	private $_albums = array();
	
	public function __construct(){}
	
	/**
	 * Lägger till en användare i användar-arrayen
	 */
	public function add(Album $album)
	{
		$this->_albums[] = $album; 
	}
	
	/**
	 * Hämtar array av användare
	 * @return Array (User)
	 */
	public function get()
	{
		return $this->_albums;
	}
}

class Album
{
	private $_albumId; //Int
	private $_userId; //Int
	private $_title; //String
	private $_year; //Int
	private $_description; //String
	
	public $isValid = true;
	
	/**
	 * Instansiera objekt
	 * @param $albumId int
	 * @param $userId int
	 * @param $title string
	 * @param $year int
	 * @param $description string
	 */
	public function __construct($albumId, $userId, $title, $year, $description)
	{
		$this->_albumId = $albumId;
		$this->_userId = $userId;
		$this->_title = $title;
		$this->_year = $year;
		$this->_description = $description;
		
		if(!is_numeric($albumId) || !is_numeric($userId) || !is_numeric($year))
			$this->isValid = false;
		
		if($year = "" || $title = "")
			$this->isValid = false;
	}
	
	public function AlbumId()
	{
		return $this->_albumId;
	}
	
	public function UserId()
	{
		return $this->_userId;
	}
	
	public function Title()
	{
		return $this->_title;
	}
	
	public function Year()
	{
		return $this->_year;
	}
	
	public function Description()
	{
		return $this->_description;
	}
}

?>